class List {

  constructor() {
    this.arr = [];
  }

  add(e) {
    this.arr.push(e);
  }

  addAll(list) {
    for (let i = 0; i < list.length; i++) {
      this.add(list[i])
    }
  }

  getValue() {
    return this.arr;
  };
}

class InstrumentList extends List {

  constructor() {
    super();
    this.addCount = 0;
  }

  add(e) {
    this.addCount++;
    super.add(e);
  }

  addAll(list) {
    this.addCount += list.length;
    super.addAll(list);
  }

  getCount() {
    return this.addCount;
  }
}
class InstrumentListC  {
  list;
  constructor() {
    this.addCount = 0;
  }

  add(e) {
    list.add(e);
    this.addCount++;
  }

  addAll(list) {
    list.addAll(list);
    this.addCount += list.length;
  }

  getCount() {
    return this.addCount;
  }
}

let myList = new InstrumentList();
// myList.add(1);
// myList.add(3);
// console.log(myList.getCount())
myList.addAll([1, 2, 7, 8]);
console.log(myList.getCount())
